<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ include file="../common/include/header.jsp"%>

<%@page import="board.PhotoForm"%>

<div style="width: 980px">
<table border="0" cellpadding="0" cellspacing="0" width="980px">
	<tr>
	
		<td style="vertical-align: top;width: 180px;background-color: #fdb73a;">
			<%@ include file="../common/include/leftmenu.jsp"%>
		</td>
		
		<td style="text-align: center;width: 800px;background: #ffffff; vertical-align: top;">
			<table style="width: 800px;" cellpadding="0" cellspacing="0">
				<tr>
				<td style="width: 600px; vertical-align: top;">
					<div style="height: 10px;"></div>
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
						<td style="width: 80px;">
							<img src="<%=imagePath%>photomain_02.jpg"/>
						</td>
						<td style="padding:15px;border: 1px dotted #dddddd;">
							<logic:iterate id="newboard" name="photoForm" property="topNewList" type="model.PhotoBoard">
							<div style="width: 160px; height: 160px; float: left">
								<table border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td>
											<a href="javascript:getBoard('photoboard.do?method=photoView&rownum=<bean:write name="newboard" property="rownum"/>&pbno=', '<bean:write name="newboard" property="pbno"/>')">
												<img src="<%=path%>/uploadfiles/<%=newboard.getPbsfn()%>" width="120px" height="120px" border="" onmouseover="pop('<%=newboard.getMid()%>','<%=newboard.getPbtitle()%>','<%=newboard.getPbcounter()%>')" onmouseout="kill()"/>
											</a>
										</td>
									</tr>
									<tr>
										<td bgcolor="#efefef" width="120px">
											<bean:write name="newboard" property="rownum"/>.&nbsp;
											<a href="javascript:getBoard('photoboard.do?method=photoView&rownum=<bean:write name="newboard" property="rownum"/>&pbno=', '<bean:write name="newboard" property="pbno"/>')">
												<%if(newboard.getPbtitle().length()<7){%>
													<bean:write name="newboard" property="pbtitle"/>
												<%}else{%>
													<%=newboard.getPbtitle().substring(0,6)+"..."%>
												<%}%>
											</a>
										</td>
									</tr>
									<tr>
										<td bgcolor="#efefef" width="120px">
											<bean:write name="newboard" property="pbdate"/>
										</td>
									</tr>
								</table>
							</div>
							</logic:iterate>
						</td>
						</tr>
					</table>
					<br/>
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
						<td style="width: 80px;">
							<img src="<%=imagePath%>photomain_03.jpg"/>
						</td>
						<td style="padding:15px;border: 1px dotted #dddddd;">
							<logic:iterate id="bestboard" name="photoForm" property="topBestList" type="model.PhotoBoard">
							<div style="width: 160px; height: 160px; float: left;">
								<table border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td>
											<a href="javascript:getBoard('photoboard.do?method=photoView&rownum=<bean:write name="bestboard" property="rownum"/>&pbno=', '<bean:write name="bestboard" property="pbno"/>')">
												<img src="<%=path%>/uploadfiles/<%=bestboard.getPbsfn()%>" width="120px" height="120px" border="" onmouseover="pop('<%=bestboard.getMid()%>','<%=bestboard.getPbtitle()%>','<%=bestboard.getPbcounter()%>')" onmouseout="kill()"/>
											</a>
										</td>
									</tr>
									<tr>
										<td bgcolor="#efefef" width="120px">
											<bean:write name="bestboard" property="rownum"/>.&nbsp;
											<a href="javascript:getBoard('photoboard.do?method=photoView&rownum=<bean:write name="bestboard" property="rownum"/>&pbno=', '<bean:write name="bestboard" property="pbno"/>')">
												<%if(bestboard.getPbtitle().length()<7){%>
													<bean:write name="bestboard" property="pbtitle"/>
												<%}else{%>
													<%=bestboard.getPbtitle().substring(0,6)+"..."%>
												<%}%>
											</a>
										</td>
									</tr>
									<tr>
										<td bgcolor="#efefef" width="120px">
											<bean:write name="bestboard" property="pbdate"/>
										</td>
									</tr>
								</table>
							</div>
							</logic:iterate>
						</td>
						</tr>
					</table>
				</td>
				<td style="width: 200px;height: 440px;vertical-align: top;"><img src="<%=imagePath%>photomain_01.jpg" border="0"/></td>
				</tr>
			</table>
		</td>
		
	</tr>
</table>
</div>

<div id="topdeck" style="position: absolute; display: none;"/>

<%@ include file="../common/include/footer.jsp" %>

<script type="text/javascript">
	
	//사진에 말풍선 띄우는 스크립트//////////////////////////////
	var nav = (document.layers);
	var iex = (document.all);
	var skn = (nav)? document.topdeck : topdeck.style;
	
	if(nav){
		document.captureEvents(Event.MOUSEMOVE);
	}
	
	document.onmousemove = get_mouse;
	
	function pop(mid, pbtitle, pbcounter){
		var content = "<table cellpadding='3' cellspacing='0' class='photoPop'>" +
						"<tr><td>작성자 : " + mid + "</td></tr>" +
						"<tr><td>제목 : " + pbtitle + "</td></tr>" +
						"<tr><td>조회수 : " + pbcounter + "</td></tr></table>"
		if(nav){
			skn.document.write(content);
			skn.document.close();
			skn.display = "";
		}else if(iex){
			document.all("topdeck").innerHTML = content;
			skn.display = "";
		}
	}
	
	function get_mouse(e){
		var x = (nav)? e.pageX : event.x + document.body.scrollLeft;
		var y = (nav)? e.pageY : event.y + document.body.scrollTop;
		skn.left = x - 0;
		skn.top = y + 20;
	}
	
	function kill(){
		skn.display = "none";
	}
	
</script>
